package model

import "time"

const AlertRuleTable = "alert_rule"

const (
	ANNOUNCE_TYPE_SERVICE   int = 1 // 服务
	ANNOUNCE_TYPE_NODE      int = 2 // 节点
	ANNOUNCE_TYPE_OPERATION int = 3 // 高危操作

	ALERT_TYPE_MESSAGE int = 1 // 短信
)

type AlertRule struct {
	Id              int       `json:"id" gorm:"primaryKey;autoIncrement;comment:id"`
	NodePrimaryId   int       `json:"node_primary_id" gorm:"comment:node_primary_id"`
	RuleName        string    `json:"rule_name" gorm:"rule_name"`
	AnnounceType    int       `json:"announce_type" gorm:"announce_type"`
	AlertType       int       `json:"alert_type" gorm:"alert_type"`
	AlertQuota      string    `json:"alert_quota" gorm:"alert_quota"`
	AlertUserId     int       `json:"alert_user_id" gorm:"alert_user_id"`
	TriggerOperator string    `json:"trigger_operator" gorm:"trigger_operator"`
	TriggerValue    string    `json:"trigger_value" gorm:"trigger_value"`
	Status          int       `json:"status" gorm:"status"`
	CreateUserName  string    `json:"create_user_name" gorm:"create_user_name"`
	CreateTime      time.Time `json:"create_time" gorm:"create_time"`
	UpdateUserName  string    `json:"update_user_name" gorm:"update_user_name"`
	UpdateTime      time.Time `json:"update_time" gorm:"update_time"`
}
